<script setup>
import { ref } from 'vue'

const searchQuery = ref('')
const performSearch = () => {
  console.log('搜索内容:', searchQuery.value)
}
</script>

<template>
  <div class="search-container">
    <input
      v-model="searchQuery"
      type="text"
      placeholder="请输入搜索内容"
      class="search-input"
    />
    <button @click="performSearch" class="search-button">搜索</button>
  </div>
</template>

<style scoped>
.search-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.search-input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 20px;
  outline: none;
  transition: border 0.3s;
  width: 300px;
}

.search-input:focus {
  border: 1px solid #3670ee;
}

.search-button {
  padding: 10px 15px;
  margin-left: 10px;
  border: none;
  border-radius: 20px;
  background-color: #3670ee;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

.search-button:hover {
  background-color: #2858c5;
}
</style>
